import React from 'react'
import { Tag } from 'antd';
export default function GoodsParams(props:GoodParamsPropsType) {
  console.log(props.params)
  return (
    <div>
        {
          props.params.map((item:ParamsAttrType,index:number)=>{
            return (
              <div key={index}>
                <div>{item.attr_name}</div>
                <div style={{margin:"15px 0"}}>
                  {
                     (item.attr_vals as string[]).map((value:string,i:number)=>{
                        return    <Tag color="processing" key={i} closable onClose={()=>{
                          // 子组件向父组件传值 告诉父组件删除对应得params
                         ( props.removeTag as Function)(index,i)
                        }}>{value}</Tag>
                     })
                  }
                </div>
              </div>
            )
          })
        }
    </div>
  )
}
